From: Colin Walters Date: Wed, 16 Jul 2025 16:56:49 +0000 (-0400) Subject: prepare-root: Rename `enabled` -> `composefs_enabled` X-Git-Tag: archive/raspbian/2025.7-2+rpi1^2^2~6^2~3^2~4^2~1 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=05460e8bbc1844df66e4481b608151ff1474cb11;p=ostree.git prepare-root: Rename `enabled` -> `composefs_enabled` Prep for moving more functionality there, it's really about the rootfs, not just composefs. Signed-off-by: Colin Walters --- diff --git a/src/libostree/ostree-soft-reboot.c b/src/libostree/ostree-soft-reboot.c index 2c728a3c..7ed7e067 100644 --- a/src/libostree/ostree-soft-reboot.c +++ b/src/libostree/ostree-soft-reboot.c @@ -61,7 +61,7 @@ _ostree_prepare_soft_reboot (GError **error) if (!rootfs_config) return FALSE; - if (rootfs_config->enabled != OT_TRISTATE_YES) + if (rootfs_config->composefs_enabled != OT_TRISTATE_YES) return glnx_throw (error, "soft reboot not supported without composefs"); GVariantBuilder metadata_builder; diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index 749436bd..1b34833f 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -661,7 +661,7 @@ checkout_deployment_tree (OstreeSysroot *sysroot, OstreeRepo *repo, const char * if (!rootfs_config) return glnx_prefix_error (error, "Reading rootfs config"); - OtTristate composefs_enabled = rootfs_config->enabled; + OtTristate composefs_enabled = rootfs_config->composefs_enabled; g_debug ("composefs enabled by config: %d repo: %d", composefs_enabled, repo->composefs_wanted); if (repo->composefs_wanted == OT_TRISTATE_YES) composefs_enabled = repo->composefs_wanted; diff --git a/src/libotcore/otcore-prepare-root.c b/src/libotcore/otcore-prepare-root.c index 98cb51d5..df5d3b0d 100644 --- a/src/libotcore/otcore-prepare-root.c +++ b/src/libotcore/otcore-prepare-root.c @@ -188,19 +188,19 @@ otcore_load_rootfs_config (const char *cmdline, GKeyFile *config, gboolean load_ OTCORE_PREPARE_ROOT_ENABLED_KEY, NULL); if (g_strcmp0 (enabled, "signed") == 0) { - ret->enabled = OT_TRISTATE_YES; + ret->composefs_enabled = OT_TRISTATE_YES; ret->require_verity = true; ret->is_signed = true; } else if (g_strcmp0 (enabled, "verity") == 0) { - ret->enabled = OT_TRISTATE_YES; + ret->composefs_enabled = OT_TRISTATE_YES; ret->require_verity = true; ret->is_signed = false; } else if (!ot_keyfile_get_tristate_with_default (config, OTCORE_PREPARE_ROOT_COMPOSEFS_KEY, OTCORE_PREPARE_ROOT_ENABLED_KEY, OT_TRISTATE_NO, - &ret->enabled, error)) + &ret->composefs_enabled, error)) return NULL; // Look for a key - we default to the initramfs binding path. @@ -243,7 +243,7 @@ otcore_load_rootfs_config (const char *cmdline, GKeyFile *config, gboolean load_ { if (g_strcmp0 (ostree_composefs, "signed") == 0) { - ret->enabled = OT_TRISTATE_YES; + ret->composefs_enabled = OT_TRISTATE_YES; ret->is_signed = true; ret->require_verity = true; } @@ -251,7 +251,7 @@ otcore_load_rootfs_config (const char *cmdline, GKeyFile *config, gboolean load_ { // The other states force off signatures ret->is_signed = false; - if (!_ostree_parse_tristate (ostree_composefs, &ret->enabled, error)) + if (!_ostree_parse_tristate (ostree_composefs, &ret->composefs_enabled, error)) return glnx_prefix_error (error, "handling karg " CMDLINE_KEY_COMPOSEFS), NULL; } } @@ -450,7 +450,7 @@ otcore_mount_rootfs (RootConfig *rootfs_config, GVariantBuilder *metadata_builde #ifdef HAVE_COMPOSEFS /* We construct the new sysroot in /sysroot.tmp, which is either the composefs mount or a bind mount of the deploy-dir */ - if (rootfs_config->enabled == OT_TRISTATE_NO) + if (rootfs_config->composefs_enabled == OT_TRISTATE_NO) return TRUE; g_autofree char *sysroot_objects = g_strdup_printf ("%s/ostree/repo/objects", root_mountpoint); @@ -549,8 +549,8 @@ otcore_mount_rootfs (RootConfig *rootfs_config, GVariantBuilder *metadata_builde else { int errsv = errno; - g_assert (rootfs_config->enabled != OT_TRISTATE_NO); - if (rootfs_config->enabled == OT_TRISTATE_MAYBE && errsv == ENOENT) + g_assert (rootfs_config->composefs_enabled != OT_TRISTATE_NO); + if (rootfs_config->composefs_enabled == OT_TRISTATE_MAYBE && errsv == ENOENT) { g_print ("composefs: No image present\n"); } @@ -562,7 +562,7 @@ otcore_mount_rootfs (RootConfig *rootfs_config, GVariantBuilder *metadata_builde } #else /* if composefs is configured as "maybe", we should continue */ - if (rootfs_config->enabled == OT_TRISTATE_YES) + if (rootfs_config->composefs_enabled == OT_TRISTATE_YES) return glnx_throw (error, "composefs: enabled at runtime, but support is not compiled in"); #endif *out_using_composefs = using_composefs; diff --git a/src/libotcore/otcore.h b/src/libotcore/otcore.h index 070498a2..47aa751b 100644 --- a/src/libotcore/otcore.h +++ b/src/libotcore/otcore.h @@ -66,7 +66,7 @@ GKeyFile *otcore_load_config (int rootfs, const char *filename, GError **error); typedef struct { - OtTristate enabled; + OtTristate composefs_enabled; gboolean require_verity; gboolean is_signed; char *signature_pubkey; diff --git a/src/switchroot/ostree-prepare-root.c b/src/switchroot/ostree-prepare-root.c index 45899727..b0011799 100644 --- a/src/switchroot/ostree-prepare-root.c +++ b/src/switchroot/ostree-prepare-root.c @@ -199,7 +199,7 @@ main (int argc, char *argv[]) // If composefs is enabled, that also implies sysroot.readonly=true because it's // the new default we want to use (not because it's actually required) - const bool sysroot_readonly_default = rootfs_config->enabled == OT_TRISTATE_YES; + const bool sysroot_readonly_default = rootfs_config->composefs_enabled == OT_TRISTATE_YES; if (!ot_keyfile_get_boolean_with_default (config, SYSROOT_KEY, READONLY_KEY, sysroot_readonly_default, &sysroot_readonly, &error)) errx (EXIT_FAILURE, "Failed to parse sysroot.readonly value: %s", error->message); @@ -231,7 +231,7 @@ main (int argc, char *argv[]) * However, we only do this if composefs is not enabled, because we don't * want to parse the target root filesystem before verifying its integrity. */ - if (!sysroot_readonly && rootfs_config->enabled != OT_TRISTATE_YES) + if (!sysroot_readonly && rootfs_config->composefs_enabled != OT_TRISTATE_YES) { sysroot_readonly = sysroot_is_configured_ro (root_arg); // Encourage porting to the new config file